package com.kede.api.level.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kede.api.level.domain.SyPerm;
import com.kede.api.level.mapper.SyPermMapper;
import com.kede.api.level.service.ISyPermService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * @Author 乔包包
 * @PackageName server-parent-master
 * @Package com.kede.api.level.service.impl
 * @Date 2024/2/3 14:11
 * @Version 1.0
 */
@Service
public class SyPermServiceImpl extends ServiceImpl<SyPermMapper,SyPerm> implements ISyPermService {

    @Override
    public List<SyPerm> listPermsByIds(Set<Integer> ids) {
        LambdaQueryWrapper<SyPerm> wp = new LambdaQueryWrapper<>();
        wp.in(SyPerm::getId,ids);
        wp.eq(SyPerm::getIsDel,0);
        wp.eq(SyPerm::getStatus,1);
        return this.list(wp);
    }

    @Override
    public List<SyPerm> listAllPerms() {
        LambdaQueryWrapper<SyPerm> wp = new LambdaQueryWrapper<>();
        wp.eq(SyPerm::getIsDel,0);
        wp.eq(SyPerm::getStatus,1);
        return this.list(wp);
    }
}
